package com.anywhere.freightman.system.service;

import com.anywhere.freightman.common.IBaseEntityService;
import com.anywhere.freightman.common.entity.user.RoleQueryEntity;
import com.anywhere.freightman.system.model.Resource;
import com.anywhere.freightman.system.model.Role;
import com.anywhere.freightman.system.model.UserModel;

import java.util.List;
import java.util.Set;

public interface IRoleService extends IBaseEntityService<Role, RoleQueryEntity> {

    List<Role> getListByUserId(long userId);

    Set<Resource> getResource(long roleId);

    Set<Resource> getResourceByUserId(long userId);

    List<Role> getListByTenantId(long companyId);

    void deleteRole(Long userId);

    void insertRole(Long userId, List<Long> roleIds);

    void insert(Role model, List<Long> resIds);

    void update(Role model, List<Long> resIds);

    List<UserModel> getUserListByRoleId(long roleId);

    Role getByCode(String code);

}
